package com.zy.error;

/**
 * Created by zhaoyang on 2019/6/20.
 */
public enum EmBussinessError implements CommonError {
    // 通用参数错误
    PARAMETER_VALIDATE_ERROR("10001","参数错误"),

    // 用户相关错误
    USER_NOT_EXIT_ERROR("20001","用户不存在"),
    USER_VALIDATE_ERROR("20002","用户名或密码不正确"),

    // 商品相关错误
    ITEM_NOT_EXIT_ERROR("30001","商品不存在")
    ;

    private String errorCode;
    private String errorMsg;

    private EmBussinessError(String errorCode,String errorMsg) {
        this.errorMsg = errorMsg;
        this.errorCode = errorCode;
    }

    @Override
    public String getErrorCode() {
        return errorCode;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }

    @Override
    public CommonError setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }
}
